﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication.Models.Product>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Index</h2>

    <table width="100%">
        <tr>
            <th>Action</th>
            <th>Product ID</th>
            <th>Product Name</th>
            <!--
            <th>Supplier ID</th>
            <th>Category ID</th>
            -->
            <th>Quantity per Unit</th>
            <th>Unit Price</th>
            <th>Units in Stock</th>
            <th>Units on Order</th>
            <th>Reorder Level</th>
            <th>Dis-continued</th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
              <%: Html.ActionLink("Details", "Details", new { id=item.ProductID })%>
              <%: Html.ActionLink("Edit", "Edit", new { id=item.ProductID })%>
              <%: Html.ActionLink("Delete", "Delete", new { id=item.ProductID })%>
            </td>
            <td><%: item.ProductID %></td>
            <td><%: item.ProductName %></td>
            <!--
            <td><%: item.SupplierID %></td>
            <td><%: item.CategoryID %></td>
            -->
            <td><%: item.QuantityPerUnit %></td>
            <td><%: String.Format("{0:F2}", item.UnitPrice) %></td>
            <td><%: item.UnitsInStock %></td>
            <td><%: item.UnitsOnOrder %></td>
            <td><%: item.ReorderLevel %></td>
            <td><%: Html.CheckBoxFor(e => item.Discontinued, new { disabled = "true" })%></td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

